Page({
  data: {
    title: '话题详情',
    detail: {},
    hidden: false
  },
  onLoad:function(options){
      this.fetchData(options.id)
  },
  fetchData:function(id){
      var _this = this;
      _this.setData({
          hidden: false
      });
      wx.request({
        url: 'https://cnodejs.org/api/v1/topic/'+id,
        header: {
            'content-type': 'application/json'
        },
        success: function(res) {
            _this.setData({
                detail : res.data.data
            });
            setTimeout(function () {
                _this.setData({
                    hidden: true
                });
            }, 300);
            
        }
    })
  }
})